package com.leon.datalink.web.controller;

import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
 * Test controller for debugging
 */
@RestController
@RequestMapping("/api/test")
public class TestController {

    @GetMapping("/hello")
    public Map<String, Object> hello() {
        Map<String, Object> result = new HashMap<>();
        result.put("message", "Hello from DataLink!");
        result.put("timestamp", System.currentTimeMillis());
        return result;
    }

    @PostMapping("/echo")
    public Map<String, Object> echo(@RequestParam String message) {
        Map<String, Object> result = new HashMap<>();
        result.put("echo", message);
        result.put("timestamp", System.currentTimeMillis());
        return result;
    }
}
